package com.server.transaction.example;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @title: TransactionService
 * @author: gyuan
 * @description
 * @date: 2023-11-17 13:33
 */
@Service
public class TransactionService1 {

    @Autowired
    private TransactionService2 transactionService2;

    @Transactional(rollbackFor = Exception.class)
    public String test1() {
        System.out.println("execute TransactionService1 method test1...");
        transactionService2.test2();
        return "success";
    }
}
